package com.cheng.controller;

import com.cheng.common.exception.CommonException;
import com.cheng.common.results.DataRslt;
import com.cheng.data.vo.PermInfoVO;
import com.cheng.data.vo.ReqPageInfoVO;
import com.cheng.data.vo.RespPageInfoVO;
import com.cheng.operation.PermInfoOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author: ChengJW
 * @date: 2021/11/13 17:38
 * @version: 1.0
 * @description: 权限信息处理类
 */
@Controller
public class PermissionAdminController extends BaseController{

    private final static Logger log = LoggerFactory.getLogger(PermissionAdminController.class);

    @Autowired
    private PermInfoOperation permInfoOperation;

    @RequestMapping("/systemDefend/permissionAdmin")
    public String permissionAdmin(){
        return "permissionAdmin";
    }

    /**
    * @author: ChengJW
    * @params: [permInfoVO]
    * @return: com.cheng.common.results.DataRslt
    * @date: 2021/11/13
    * @description: 查询权限信息
    */
    @RequestMapping("/systemDefend/PermInfoAdmin/selectPermInfoInfo")
    @ResponseBody
    public DataRslt queryPermInfoList(ReqPageInfoVO reqPageInfoVO) throws CommonException{

        //将一级菜单权限值存入到第一个查询条件参数中
        //将二级菜单权限值存入到第二个查询条件参数中
        //将菜单名称(中文描述)存入到第三个查询条件参数中
        RespPageInfoVO respPageInfoVO = permInfoOperation.queryPermInfoList(reqPageInfoVO);
        return tabSuccess(respPageInfoVO);
    }
}
